<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>

<body>

  <div id="app">
    <cpn></cpn>
    <cpn></cpn>
    <cpn2></cpn2>
    <cpn2></cpn2>
  </div>

  <!-- script标签，注意类型必须是text/x-template -->
  <script type="text/x-template" id="cpn">
    <div>
      <h2>我是标题</h2>
      <p>我是内容11111</p>
      <h2>{{title}}</h2>
    </div>
  </script>

  <template id="cpn2">
    <div>
      <h2>我是标题2</h2>
      <p>我是内容2222</p>
    </div>
  </template>


  <script src="../js/vue.js"></script>
  <script>

    Vue.component('cpn', {
      template: '#cpn',
      data() {
        return {
          title: 'abc'
        }
      }
    })
    Vue.component('cpn2', {
      template: '#cpn2'
    })

    const app = new Vue({
      el: '#app',
      data: {
        message: 'Hello'
      },
    })
  </script>

  
</body>

</html>